<!-- 添加、编辑增员对象 -->

<ion-header>
    <ion-toolbar content-page>
        <ion-buttons start>
            <button ion-button icon-only (click)="backToProPage(0)">
                <i class="back">取消</i>
            </button>
        </ion-buttons>
        <ion-title>{{staffData?"编辑增员对象":"添加增员对象"}}</ion-title>
        <ion-buttons end>
            <button ion-button icon-only [disabled]="isDisabled" (click)="addStaffCust($event)">
                <i>保存</i>
            </button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>
<!--<ion-content (click)="clickContent(staffModel.mobileList)">-->
<ion-content (ionScroll)="onScroll()">
    <ion-list class="topList">
        <!--姓名-->
        <ion-item class="name">
            <ion-label>姓名</ion-label>
            <ion-input #name class="nameInp"
                       [(ngModel)]="staffModel.name" placeholder="请填写" maxlength="20"
                       [disabled]="staffData && (!!staffData.virtualTime || !!staffData.itcTime || staffData.onbroadingTime)"></ion-input>
        </ion-item>
        <!--性别-->
        <ion-item (click)="chooseSex()">
            <ion-label disabled class="sexLabel" >性别
                <span [ngClass]="staffModel.sex=='请选择'?'chooseSex':''">{{staffModel.sex}}</span>
            </ion-label>
            <ion-icon class="choose" item-end></ion-icon>
        </ion-item>
        <!--生日-->
        <ion-item>
            <ion-label class="birChoose">生日</ion-label>
            <ion-datetime #birChoose cancelText="取消" doneText="确定"
                          displayFormat="YYYY/MM/DD" [(max)]="maxDate" placeholder="请选择"
                          [yearValues]="getYearList(maxDateYear-100,maxDateYear)"
                          [pickerOptions]="pickerOptions" [(ngModel)]="staffModel.birthday">
            </ion-datetime>
            <ion-icon class="choose" item-end></ion-icon>
        </ion-item>

        <!--电话-->
        <ion-item-sliding #slidingItem
                          *ngFor="let a of staffModel.mobileList;let i=index">
            <ion-item class="telPhone">
                <ion-label class="span-label">电话{{i>0?(i+1):''}}</ion-label>

                <ion-input #tel type="tel" class="phone-number" [disabled]="a.defaultIndicator==0"
                           pattern="/[0-9]*/" placeholder="请填写" (focus)="inputFocus($event)"
                           [(value)]="staffModel.mobileList[i].mobile"
                           (ionChange)="inputOnchangeTel(i,$event)">
                </ion-input>

            </ion-item>
            <ion-item-options side="right" *ngIf="i!=0">
                <button item-end class="delPhone">
                    <span (click)="delLocalPhone(i,$event,a)">删除</span>
                </button>
            </ion-item-options>
        </ion-item-sliding>

        <!--添加电话 -->
        <ion-item class="phoneAndAddBox" (click)="addNewPhone($event)">
            <div class="phoneAndAdd">
                <img src="./assets/images/client/client-add/icon_add.png" alt="">
                添加电话
            </div>
        </ion-item>
        <!--<ion-item><div class="phoneAndAdd" (click)="addNewPhone($event)">添加电话</div></ion-item>-->
        <!--学历-->
        <ion-item class="name">
            <ion-label>学历</ion-label>
            <ion-select placeholder="请选择" cancelText="取消" #select
                        interface="action-sheet" [(ngModel)]="staffModel.education">
                <ion-option value="ABO">本科以上</ion-option>
                <ion-option value="UNI">本科</ion-option>
                <ion-option value="COL">大专</ion-option>
                <ion-option value="HIG">高中或同等学历</ion-option>
                <ion-option value="JMS">初中</ion-option>
            </ion-select>
        </ion-item>
        <!--工作年限-->
        <ion-item>
            <ion-label>工作年限</ion-label>
            <ion-input #name  type="tel" (focus)="inputFocus($event)"
                        [(ngModel)]="staffModel.workingYears"
                       (ionChange)="inputOnchangeJob($event)"
                       placeholder="请填写" maxlength="2"></ion-input>
        </ion-item>
        <!--婚育-->
        <ion-item>
            <ion-label>婚否</ion-label>
            <ion-select placeholder="请选择" cancelText="取消" #select1
                        interface="action-sheet" [(ngModel)]="staffModel.isMarry">
                <ion-option value="1">已婚</ion-option>
                <ion-option value="2">未婚</ion-option>
                <ion-option value="3">其他</ion-option>
            </ion-select>
        </ion-item>
        <!--子女-->
        <ion-item>
            <ion-label>子女数量</ion-label>
            <ion-select placeholder="请选择" cancelText="取消" #select2
                        interface="action-sheet" [(ngModel)]="staffModel.childNum">
                <ion-option value="1">0个</ion-option>
                <ion-option value="2">1个</ion-option>
                <ion-option value="3">2个</ion-option>
                <ion-option value="4">3个及以上</ion-option>
            </ion-select>
        </ion-item>
        <!--月收入-->
        <ion-item class="salary"  (click)="chooseSalary()">
            <ion-label disabled class="incomeLabel">年收入
                <span [ngClass]="staffModel.income=='请选择'?'chooseSex':''">{{staffModel.income}}</span>
            </ion-label>
            <ion-icon class="choose" item-end></ion-icon>
        </ion-item>
    </ion-list>
</ion-content>
